In   -
Out  PServ
Type Module

DEFINE MODULE
  NAME      PrinterServer
  VERSION   0.30
  AUTHOR    Chris Johns
  HELP      Printer Server
  INIT      modinit
  FINAL     modfinal
  COMMANDS
   NAME    PSReset
   CODE    psreset
   MAX     0
   MIN     0
   SYNTAX  Syntax : *PSReset
   HELP    *PSReset resets the printer server. Any job will be aborted.
   NAME    PSName
   CODE    psname
   MAX     1
   MIN     0
   SYNTAX  Syntax : *PSName (<printer name>)
   HELP ...
    *PSName sets the name of the printer server or displays the current name.
   NAME    PSInfo
   CODE    psinfo
   MAX     0
   MIN     0
   SYNTAX  Syntax : *PSInfo
   HELP    *PSInfo gives information about the printer server.
END COMMANDS
END MODULE

#REM OFF
;---------------------------------------------------------------------------
; Module Initialisation
;---------------------------------------------------------------------------
.modinit
   STMFD   r13!,{r0-r4,link}             ; Stack regs.

   SWI     "Econet_ReadLocalStationAndNet"; Read our station
   STR     r0,ourstn                     ; Store station
   STR     r1,ournet                     ; Store net
   LADR    r0,ourstn                     ; Convert station/net
   LADR    r1,ourtxt                     ; into text
   MOV     r2,#8                         ; Buffer size
   SWI     "OS_ConvertNetStation"        ; Do conversion

   MOV     r0,#&10                       ; Claim EventV
   ADR     r1,event                      ; The handler
   MOV     r2,#0                         ;
   SWI     "OS_Claim"                    ; Claim it

   MOV     r0,#14                        ; Enable events
   MOV     r1,#14                        ; Econet rx
   SWI     "OS_Byte"                     ; Enable it
   MOV     r1,#15                        ; Econet tx
   SWI     "OS_Byte"                     ; Enable it

   MOV     r0,#&9F                       ; Claim Port
   SWI     "Econet_ClaimPort"

   BL      setup_enquiry_rxcb            ; Setup enquiry rxcb's
   BL      setup_wilddata_rxcb           ; Setup data rxcb's

   LDMIA   r13!,{r0-r4,pc}               ; Unstack Registers and return
;---------------------------------------------------------------------------
; Module Finalisation
;---------------------------------------------------------------------------
.modfinal
   STMFD   r13!,{r0-r4,link}             ; Stack regs.

   REM     "Printer Server Closing Down"

   ; Abandon open txcb/rxcbs, ignoring all errors
   LDR     r0,enq_rxcb                   ; Enquiry rxcb
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,dataw_rxcb                 ; Wilddata rxcb
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,datac_rxcb                 ; Data rxcb (for data from client)
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,data_txcb                  ; txcb for data (port &D1)
   SWI     "XEconet_AbandonTransmit"     ; Abandon it
   LDR     r0,enq_txcb                   ; txcb for enquiry replies (&9F)
   SWI     "XEconet_AbandonTransmit"     ; Abandon it

   MOV     r0,#&10                       ; Release EventV
   ADR     r1,event                      ; The handler
   MOV     r2,#0
   SWI     "OS_Release"                  ; Release it

   MOV     r0,#13                        ; Disable events
   MOV     r1,#14                        ; Econet rx
   SWI     "OS_Byte"                     ; Disable it
   MOV     r1,#15                        ; Econet tx
   SWI     "OS_Byte"                     ; Disable it

   MOV     r0,#&9F                       ; Release Port
   SWI     "Econet_ReleasePort"

   LDR     r0,crx_ptr
   CMP     r0,#0                         ; Using RMA
   MOVNE   r2,r0                         ; if so free the RMA
   MOVNE   r0,#7
   SWINE   "XOS_Module"                  ; Ignoring any error

   LDMFD   r13!,{r0-r4,pc}               ; Unstack Registers

;---------------------------------------------------------------------------
; Event handler code
;---------------------------------------------------------------------------
.event
   TEQ     r0,#14                        ; Econet RX event?
   BNE     checktx                       ; No - was it TX?
   LDR     r0,enq_rxcb                   ; Was it the enquiry block?
   TEQ     r0,r1                         ; Check
   BEQ     rx_enquiry                    ; Yes
   LDR     r0,dataw_rxcb                 ; Was it the wild data block?
   TEQ     r0,r1                         ; Check
   BEQ     rx_dataw                      ; Yes
   LDR     r0,datac_rxcb                 ; Was it the client data block?
   TEQ     r0,r1                         ; Check
   BEQ     rx_datac                      ; Yes
   MOV     r0,#14                        ; Not for us
   MOV     pc,r14                        ; Return

.checktx
   TEQ     r0,#15                        ; Econet TX event?
   MOVNE   pc,r14                        ; No - not for us
   LDR     r0,enq_txcb                   ; Was it the enquiry reply txcb?
   TEQ     r0,r1                         ; Check
   BEQ     tx_enquiry                    ; Yes
   LDR     r0,data_txcb                  ; Was it the data txcb?
   TEQ     r0,r1                         ; Check
   BEQ     tx_data                       ; Yes
   MOV     r0,#15                        ; Not for us
   MOV     pc,r14                        ; so Return

;---------------------------------------------------------------------------
; Receive Handlers
;---------------------------------------------------------------------------
.rx_dataw                                ; It was data
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   REM     "DataW"

   MOV     r0,r1                         ; What rxcb?
   SWI     "Econet_AbandonAndReadReceive"; Read and abandon it
   STR     r3,stn                        ; Station
   STR     r4,net                        ; Net
   STR     r6,rxsize                     ; Size
   BL      dataw                         ; It was data
   LDMFD   r13!,{r0-r7,pc}               ; return

.rx_datac                                ; It was data
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   REM     "DataC"

   MOV     r0,r1                         ; What rxcb?
   SWI     "Econet_AbandonAndReadReceive"; Read and abandon it
   STR     r3,stn                        ; Station
   STR     r4,net                        ; Net
   STR     r6,rxsize                     ; Size
   BL      datac                         ; It was data
   LDMFD   r13!,{r0-r7,pc}               ; return

.rx_enquiry                              ; It was an enquiry
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   REM     "Printer Server Enquiry"

   MOV     r0,r1                         ; What rxcb?
   SWI     "Econet_AbandonAndReadReceive"; Read and abandon it
   STR     r3,stn                        ; Station
   STR     r4,net                        ; Net
   STR     r6,rxsize                     ; Size
   BL      enquiry                       ; It was an enquiry

   LDMFD   r13!,{r0-r7,pc}               ; return

;---------------------------------------------------------------------------
; Transmit Handlers
;---------------------------------------------------------------------------
.tx_data                                 ; Data has been sent
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   REM     "Data TX Finished - Status %r2"

   MOV     r0,r1                         ; The txcb
   SWI     "Econet_AbandonTransmit"      ; Finished with it

;   BL      setup_wilddata_rxcb           ; Setup data rxcb's
   LDMFD   r13!,{r0-r7,pc}

.tx_enquiry                              ; Enquiry has been sent
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   REM     "Enquiry TX Finished - Satus %r2"

   MOV     r0,r1                         ; The txcb
   SWI     "Econet_AbandonTransmit"      ; Finished with it

   BL      setup_enquiry_rxcb            ; Setup enquiry rxcb's
   LDMFD   r13!,{r0-r7,pc}

;--------------------------------------------------------------------------;
; Satus request handlers                                                   ;
;--------------------------------------------------------------------------;
.enquiry
   STMFD   r13!,{r0-r7,link}             ; Stack registers

   LDRB    r0,(enqrxbuffer    +6)        ; What enquiry number was it?
   MOV     r7,r1                         ; Preserve the flag byte
   REM     "Enquiry number %r0"

   CMP     r0,#1                         ; Enq. 1
   BEQ     statusreq                     ; Status
   CMP     r0,#6                         ; Enq. 6
   BEQ     namereq                       ; Name

   REM     "Unrecognised status enquiry"

.statusreq
   REM     "Status Request"

   REM     "Checking printer name"
   MOV     r0,#0
   STRB    r0,(enqrxbuffer    +6)        ; Null-terminate the string

   MOV     r0,#0                         ; Use current territory
   SUB     r0,r0,#1                      ; (-1)
   LADR    r1,enqrxbuffer                ; The name passed
   LADR    r2,print                      ; "PRINT "
   MOV     r3,#%01                       ; Ingnore case, accent sensitive
   SWI     "Territory_Collate"           ; Compare the stringd
   BEQ     srq_accept                    ; Yes - accept the enquiry

   MOV     r0,#0                         ; Use current territory
   SUB     r0,r0,#1                      ; (ie. r0 = -1)
   LADR    r1,enqrxbuffer                ; The name passed
   LADR    r2,name                       ; the name of this printer
   MOV     r3,#%01                       ; Ingnore case, accent sensitive
   SWI     "Territory_Collate"           ; Compare the strings
   BEQ     srq_accept                    ; Yes - accept the enquiry

   LADR    r0,enqrxbuffer
   REM     "Printer name '%$0' not us."
   ; Ignore the request - recreate the rxcb
   BL      setup_enquiry_rxcb

   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and return

.srq_accept
   REM     "Printer name OK"
   LDR     r0,status                     ; Are we busy?
   STRB    r0,enquirytxbuffer            ; Store it in the buffer
   LDR     r2,cstn                       ; What station
   STRB    r2,(enquirytxbuffer+1)        ; Store it in the buffer
   LDR     r2,cnet                       ; What net
   STRB    r2,(enquirytxbuffer+2)        ; Store it in the buffer

   MOV     r0,r7                         ; flag
   MOV     r1,#&9E                       ; Port &9E (PrinterServer Enq.Rply)
   LDR     r2,stn                        ; Station
   LDR     r3,net                        ; Net
   LADR    r4,enquirytxbuffer            ; Status data
   MOV     r5,#3                         ; 3 bytes
   MOV     r6,#10                        ; Retry count
   MOV     r7,#5                         ; Delay
   SWI     "Econet_StartTransmit"        ; Start transmission
   STR     r0,enq_txcb                   ; Store the handle
   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and return

.namereq
   REM     "Name Request"

   MOV     r0,r1                         ; flag
   MOV     r1,#&9E                       ; Port &9E (PrinterServer Enq.Rply)
   LDR     r2,stn                        ; Station
   LDR     r3,net                        ; Net
   LADR    r4,name                       ; Printer Name
   MOV     r5,#6                         ; 6 bytes
   MOV     r6,#10                        ; Retry count
   MOV     r7,#5                         ; Delay
   SWI     "Econet_StartTransmit"        ; Start transmission
   STR     r0,enq_txcb                   ; Store the handle
   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and return

;--------------------------------------------------------------------------;
; Data handlers                                                            ;
;--------------------------------------------------------------------------;
.dataw                                   ; Wildcard data
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   MOV     r7,r1                         ; Preserve the flag byte

   REM     "Wilddata RX"
   ; r1 = flag

   LDR     r0,status                     ; Read busy status
   LDR     r2,cstn                       ; Read station we are busy with
   LDR     r3,cnet                       ; Read net we are busy with
   LDR     r4,stn                        ; Read station data came from
   LDR     r5,net                        ; Read net data came from

   REM     "Checking busy status"
   CMP     r0,#0                         ; Busy?
   TSTNE   r2,r4                         ; Yes - check stn
   BNE     data_end                      ; Not this one
   CMP     r0,#0                         ; Busy?
   TSTNE   r3,r5                         ; Yes - check net
   BNE     data_end                      ; Not this one

   REM     "Not busy or busy with this client"
   AND     r2,r1,#%00000001              ; r2 = seq. bits
   AND     r3,r1,#%00000110              ; r3 = mode bits
   MOV     r3,r3,LSR #1

   AND     r4,r1,#%01111000              ; r4 = task id
   MOV     r4,r4,LSR #3

;   CMP     r3,#%01                       ; Mode bits %01
;   BNE     printdata                     ; no - not 1st block
;   CMP     r2,#0                         ; Seq. bit 0
;   BNE     printdata                     ; no - not 1st block

;.establish
   REM     "Establishing Protocol"
   CMP     r4,#0                         ; Small blocks requested?
   BEQ     smallblk                      ; Yes
   BNE     largeblk                      ; No

.smallblk
   REM     "Small Blocks"
   AND     r1,r1,#%01111001              ; Mask off mode bits
   ORR     r1,r1,#%00000100              ; Set mode bits to 10
   MOV     r0,#0                         ; Not using RMA
   STR     r0,crx_ptr
   MOV     r0,#&50
   STR     r0,crx_size                   ; Buffer size =&50
   B       est_sendbyte

.largeblk
   REM     "Large blocks Requested"
   LDR     r0,stn
   LDR     r1,net
   SWI     "Econet_PacketSize"
   MOV     r0,#6
   MOV     r3,r2

   REM     "Claiming RMA"

   SWI     "XOS_Module"
   BVS     smallblk                      ; If we can't get RMA fallback
   STR     r2,crx_ptr

   REM     "Large blocks OK"

   MOV     r1,r7
   AND     r1,r1,#%01111001              ; Large blocks OK
   ORR     r1,r1,#%01000100
   STR     r3,crx_size                   ; Buffer size = whatever
   B       est_sendbyte

.est_sendbyte
   MOV     r0,#0                         ; Byte=0
   STRB    r0,datatxbuffer               ; in txbuffer

   MOV     r0,r1                         ; Flag
   MOV     r1,#&D1                       ; Port &D1 (PrinterServer Data)
   LDR     r2,stn                        ; Station
   LDR     r3,net                        ; Net
   ADR     r4,datatxbuffer               ; Transmit Buffer
   MOV     r5,#1                         ; 1 byte
   MOV     r6,#10                        ; Retry count
   MOV     r7,#5                         ; Delay
   SWI     "Econet_StartTransmit"        ; Start transmission
   STR     r0,data_txcb                  ; Store the handle

   MOV     r0,#1                         ; Set r0
   STR     r0,status                     ; we are busy

   ; Established protocol, so open parallel:
   MOV     r0,#&C0                       ; Open parallel:
   LADR    r1,parallel                   ; The filename
   SWI     "OS_Find"                     ; Open it
   STR     r0,paralf

   BL      setup_client_rxcb             ; Create a rxcb for the data

   MOV     r0,#1                         ; Were busy
   STR     r0,status                     ;
   LDR     r0,stn                        ; With this stn
   STR     r0,cstn
   LDR     r0,net                        ; With this net
   STR     r0,cnet

.data_end
   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and exit

.datac
   STMFD   r13!,{r0-r7,link}             ; Stack registers
   MOV     r7,r1                         ; Preserve the flag byte
   ; r1 = flag

   REM     "Client Data RX"

   AND     r2,r1,#%00000001              ; r2 = seq. bits
   AND     r3,r1,#%00000110              ; r3 = mode bits
   MOV     r3,r3,LSR #1
   AND     r4,r1,#%01111000              ; r4 = task id
   MOV     r4,r4,LSR #3

   STR     r3,mode_bits

.printdata
   REM     "Printing Data"

   ; Send the data
   MOV     r0,#2                         ; Write to Current pointer
   LDR     r1,paralf                     ; The file handle
   LDR     r2,crx_ptr                    ;
   CMP     r2,#0                         ; Are we using RMA?
   ADREQ   r2,datarxbuffer_c             ; No
   LDR     r3,rxsize                     ; How many bytes?
   SWI     "OS_GBPB"                     ; Write the data

.data_ack                                ; Acknknowledge the block
   REM     "ACK"
   MOV     r0,#0                         ; } Place 0 in the
   STRB    r0,datatxbuffer               ; } txbuffer
   MOV     r0,r7                         ; Flag
   MOV     r1,#&D1                       ; Port &D1 (PrinterServer Data)
   LDR     r2,stn                        ; Station
   LDR     r3,net                        ; Net
   ADR     r4,datatxbuffer               ; Transmit Buffer
   MOV     r5,#1                         ; 1 byte
   MOV     r6,#10                        ; Retry count
   MOV     r7,#5                         ; Delay
   SWI     "Econet_StartTransmit"        ; Start transmission
   STR     r0,data_txcb                  ; Store the handle

   REM     "ACKed"
   LDR     r0,mode_bits
   TEQ     r0,#%11                       ; Last block
   BEQ     print_done                    ; Yes
   BL      setup_client_rxcb             ; No  - setup new rxcb
   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and exit

.print_done
   REM     "Print Done"

   MOV     r0,#0                         ; Close parallel:
   LDR     r1,paralf                     ; The file handle
   SWI     "XOS_Find"

   REM     "Parallel closed"
   MOV     r0,#0                         ; load r0 for setting..
   STR     r0,status                     ; Not busy
   STR     r0,cnet                       ; No current net
   STR     r0,cstn                       ; No current station

   LDR     r0,crx_ptr
   CMP     r0,#0                         ; Using RMA
   MOVNE   r2,r0                         ; if so free the RMA
   MOVNE   r0,#7
   SWINE   "XOS_Module"                  ; Ignoring any error
   MOV     r0,#0                         ; No longer using RMA
   STR     r0,crx_ptr

   BL      setup_wilddata_rxcb           ; Setup new wild rxcb
   REM     "New wildrx setup"
   LDMFD   r13!,{r0-r7,pc}               ; Unstack registers and exit

;-------------------------------------------------------------------------
; *Commands
;-------------------------------------------------------------------------
.psreset                                 ; *psreset
   STMFD   r13!,{r0-r7,link}

   LDR     r0,enq_rxcb                   ; Enquiry rxcb
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,dataw_rxcb                 ; Wilddata rxcb
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,datac_rxcb                 ; Data rxcb (for data from client)
   SWI     "XEconet_AbandonReceive"      ; Abandon it
   LDR     r0,data_txcb                  ; txcb for data (port &D1)
   SWI     "XEconet_AbandonTransmit"     ; Abandon it
   LDR     r0,enq_txcb                   ; txcb for enquiry replies (&9F)
   SWI     "XEconet_AbandonTransmit"     ; Abandon it

   MOV     r0,#0                         ; Set status to
   STR     r0,status                     ; Not busy
   STR     r0,cstn                       ; No net
   STR     r0,cnet                       ; No net

   LDR     r0,crx_ptr
   CMP     r0,#0                         ; Using RMA
   MOVNE   r2,r0                         ; if so free the RMA
   MOVNE   r0,#7
   SWINE   "XOS_Module"                  ; Ignoring any error
   MOV     r0,#0                         ; No longer using RMA
   STR     r0,crx_ptr

   BL      setup_enquiry_rxcb            ; Setup enquiry rxcb's
   BL      setup_wilddata_rxcb           ; Setup data rxcb's

   LDMIA   r13!,{r0-r7,pc}

.psname                                  ; *psname
   STMFD   r13!,{r0-r7,link}             ; stack registers
   CMP     r1,#0                         ; was a name passed
   BEQ     printname                     ; No - print the name
   BGT     setname                       ; Yes - change the name

.printname                               ; Print the printer name
   SWI     "OS_WriteS"                   ; Output the header
   EQUZA   "Printer Name : "
   ADR     r0,name                       ; Pointer to name
   SWI     "OS_Write0"                   ; Output it
   SWI     "OS_NewLine"                  ; Newline
   LDMIA   r13!,{r0-r7,pc}               ; Unstack and return

.setname                                 ; Set the name
   MOV     r7,#0                         ; Byte counter
   MOV     r6,#0                         ; Clear r6
   ADR     r1,name                       ; where we are copying text to
.copyname                                ; Copy the name
   CMP     r6,#32                        ; Are we padding?
   LDRNEB  r6,[r0,r7]                    ; No - Read a byte
   CMP     r6,#13                        ; Is it the end of the name?
   MOVEQ   r6,#32                        ; Yes - spaces
   STRB    r6,[r1,r7]                    ; Store the byte
   ADD     r7,r7,#1                      ; Inc. counter
   CMP     r7,#6                         ; Finished?
   BLT     copyname                      ; No - next byte
   B       printname                     ; Display the new name

.psinfo                                  ; *psinfo command
   STMFD   r13!,{r0-r7,link}             ; stack registers

   SWI     "OS_WriteS"                   ; Output the text
   EQUZA   "  Printer name   : "
   ADR     r0,name                       ; pointer to name
   SWI     "OS_Write0"                   ; Write it
   SWI     "OS_NewLine"                  ; New line

   SWI     "OS_WriteS"                   ; Output the text
   EQUZA   "  Server station : "
   LADR    r0,ourtxt                     ; pointer to stattion string
   SWI     "OS_Write0"                   ; Write it
   SWI     "OS_NewLine"                  ; New line

   SWI     "OS_WriteS"
   EQUZA   "  Server status  : "

   LDR     r0,status
   CMP     r0,#0
   BEQ     info_ready
   BNE     info_busy

.info_ready                              ; Ready
   SWI     "OS_WriteS"
   EQUZA   "Ready"
   SWI     "OS_NewLine"
   B       info_end

.info_busy
   SWI     "OS_WriteS"
   EQUZA   "Busy with "
   ADR     r0,cstn
   LADR    r1,busytxt
   MOV     r2,#8
   SWI     "OS_ConvertNetStation"
   LADR    r0,busytxt
   SWI     "OS_Write0"
   SWI     "OS_NewLine"

.info_end
   LDMIA   r13!,{r0-r7,pc}               ; Unstack and return

;-------------------------------------------------------------------------
; PrinterServer Internal Routines
;-------------------------------------------------------------------------
.setup_enquiry_rxcb
   STMFD   r13!,{link}                   ; Preserve lr
   MOV     r0,#&9F                       ; Port &9F
   MOV     r1,#&FF                       ; Any station
   MOV     r2,#&FF                       ; Any net
   ADR     r3,enqrxbuffer                ; The buffer..
   MOV     r4,#&10                       ;  ..is 16 bytes long
   SWI     "Econet_CreateReceive"        ; Create the rxcb
   STR     r0,enq_rxcb                   ; Remember its handle
   LDMFD   r13!,{pc}                     ; Return

.setup_wilddata_rxcb
   STMFD   r13!,{link}                   ; Preserve lr
   MOV     r0,#&D1                       ; Port &D1 (PrinterServer Data)
   MOV     r1,#&FF                       ; Any station
   MOV     r2,#&FF                       ; Any net
   ADR     r3,datarxbuffer_w             ; The buffer..
   MOV     r4,#&10                       ;  ..is 16 bytes long
   SWI     "XEconet_CreateReceive"       ; Create the rxcb
   STR     r0,dataw_rxcb                 ; Remember its handle
   LDMFD   r13!,{pc}                     ; Return

.setup_client_rxcb
   STMFD   r13!,{link}                   ; Preserve lr
   MOV     r0,#&D1                       ; Port
   LDR     r1,stn                        ; Station
   LDR     r2,net                        ; Net
   LDR     r3,crx_ptr                    ; Read pointer
   CMP     r3,#0                         ; Using RMA?
   ADREQ   r3,datarxbuffer_c             ; Data buffer
   LDR     r4,crx_size                   ; Buffer size
   SWI     "Econet_CreateReceive"        ; Create the rxcb
   STR     r0,datac_rxcb                 ; Store the handle
   LDMFD   r13!,{pc}                     ; Return

;-------------------------------------------------------------------------
; Nasty Storage shoved on the end of the module..
;-------------------------------------------------------------------------
.status     EQUD 0                       ; The printer status
.paralf     EQUD 0                       ; The file handle for parallel:

.ourstn     EQUD 0                       ; Our station number
.ournet     EQUD 0                       ; Our network number
.stn        EQUD 0                       ; The station the packet came from
.net        EQUD 0                       ; The net the packet came from
.cstn       EQUD 0                       ; The client stn we are busy with
.cnet       EQUD 0                       ; The client net we are busy with

.mode_bits  EQUD 0                       ; Mode bits
.rxsize     EQUD 0                       ; The size of the rx. buffer

.enq_rxcb   EQUD 0                       ; Enquiry rxcb
.dataw_rxcb EQUD 0                       ; Wild Data rxcb
.datac_rxcb EQUD 0                       ; Client Data rxcb

.data_txcb  EQUD 0                       ; txcb for data (port &D1)
.enq_txcb   EQUD 0                       ; txcb for enquiry replies (&9F)

.enquirytxbuffer                         ; Buffer for tx eqnuiry replies
   RES 16

.datatxbuffer                            ; Buffer for tx. data
   RES 16

.enqrxbuffer                             ; Buffer for rx. enquiries
   RES 16

.datarxbuffer_c                          ; Buffer for rx. data
   RES 96

.datarxbuffer_w                          ; Buffer for wild rx data
   RES 16

.crx_ptr   EQUD 0                        ; Pointer to RMA rx buffer, or NULL
                                         ; to use internal buffer
.crx_size  EQUD 0                        ; The size of the buffer (for rxcb
                                         ; creation only)

.name      EQUS   "CANON ":EQUB 0        ; The name of this printer
.print     EQUS   "PRINT ":EQUB 0        ; "PRINT " ;)
.parallel  EQUS   "Parallel:":EQUB 13    ; "Parallel" (filename for opening)
.ourtxt    EQUS   "xxx.xxx ":EQUB 0      ; Our net.stn (text)
.busytxt   EQUS   "xxx.xxx ":EQUB 0      ; Text of stn busy with (psinfo)
